﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class Log
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            HttpSessionState session =System.Web.HttpContext.Current.Session;
            pg.dict = BasePage.getDict(session);
            pg.Type = "Log";
            pg.LocateText = "操作日志信息查询";
            pg.SMenuId = "CS05";
            pg.FileUrl = "";
            pg.Condition = "";
            pg.TableName = "tb_sys_log";
            pg.KeyFieldName = "id";
            pg.PopEditHeight = 250;
            pg.PopEditWidth = 350;
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
            pg.Sop.ADD = false; pg.Sop.EDIT = false; pg.Sop.EXPORT = true;
            pg.Sql = "select id,ddate,sshowname,soperate,sresult,sip from tb_sys_log where 1=1";
            ColumnInfo cl;
            cl = new ColumnInfo(); cl.DataType = Tag.DateTime; cl.FieldName = "ddate"; cl.HeadText = "时间"; cl.IsCondition = true; cl.Style = "width:200px"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "sshowname"; cl.HeadText = "用户名"; cl.IsCondition = true; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "sip"; cl.HeadText = "IP地址"; cl.IsCondition = true; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "soperate"; cl.HeadText = "操作"; cl.IsCondition = true; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "sresult"; cl.HeadText = "操作结果"; cl.IsCondition = true; pg.AddColumn(cl);
            return pg;
        }
    }
}